//
//  HPSwiperResult.h
//  HPZZTong
//
//  Created by wenjun on 14-5-6.
//  Copyright (c) 2014年 Handpay. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum {
    HPSwiperResultNone = 0,         // 初始状态
    HPSwiperResultSuccess,          // 执行成功
    HPSwiperResultBusy,             // 设备忙
    HPSwiperResultFail,             // 执行失败
    HPSwiperResultTimeout,          // 执行超时
    HPSwiperResultInterrupted,
    HPSwiperResultLowBattery,
    HPSwiperResultCancel,           // 用户取消
    HPSwiperResultNotConnected,     // 设备未连接
    HPSwiperResultDownGrage,
    HPSwiperResultSelectApplication,
    HPSwiperResultRemoveICCard,
    HPSwiperResultEMVFailed,
    HPSwiperResultUnknow,
} HPSwiperResultCode;

@interface HPSwiperResult : NSObject

@property (readonly,strong,nonatomic) NSString * message;
@property (readonly,nonatomic) HPSwiperResultCode code;
@property (readonly,strong,nonatomic) id value;

@property (strong,nonatomic) NSMutableDictionary * properties;
@property (strong,nonatomic) id userInfo;

- (BOOL)isSuccess;
- (BOOL)isCanceld;

- (void)setProperty:(id)obj forKey:(NSString *)key;

- (id)propertyForKey:(NSString *)key;

- (id)initWithCode:(HPSwiperResultCode)code message:(NSString *)message value:(id)value;

+ (HPSwiperResult *)successResult:(id)value;

+ (HPSwiperResult *)failResultWithCode:(HPSwiperResultCode)failCode;

+ (HPSwiperResult *)failResultWithMsg:(NSString *)msg;

@end
